import QtQuick 1.0
import com.nokia.symbian 1.0
import "../js/Storage.js" as Storage
import "../delegate"

PurePage {
    id: sponsorOpenPage

    anchors { fill: parent; topMargin: statusBar.height; bottomMargin: toolBar.height }
    signal downloadSponsor(string name)

    ListModel {
        id: sponsorOpenModel
    }

    ListView {
        id: sponsorOpenListView

        anchors { fill: parent}
        cacheBuffer: 2 * height
        delegate: SponsorOpenDelegate {}
        model: sponsorOpenModel
    }

    ScrollBar {
        flickableItem: sponsorOpenListView
        anchors { right: sponsorOpenListView.right; top: sponsorOpenListView.top }
    }


    onDownloadSponsor: {
        sponsorOpenModel.clear();
        Storage.getSponsorCache(name, sponsorOpenModel);


    }

}
